package com.ibsol.service
{
	import com.ibsol.database.PackageDAO;
	import com.ibsol.model.TourPackage;
	
	import mx.collections.ArrayCollection;
	
	public class PackageService{
		
		private var packageDAO:PackageDAO;
		
		public function PackageService(){
			packageDAO=new PackageDAO();
		}
		/**
		 * 按编号得到旅游套装信息
		 * @param id 旅游套装编号
		 **/
		public function getPackageListById(id:int):TourPackage{
			var tourPackage:TourPackage = new TourPackage();
			packageDAO.loadPackage(id,function (result:TourPackage):void{
				tourPackage = result;
			});
			return tourPackage;
		}
		
		/**
		 * 最多8条推荐路线
		 **/
		 public function getPackageListByIsProm():ArrayCollection{
		 	var ac:ArrayCollection=new ArrayCollection();
		 	packageDAO.getPackageListByIsProm(function (actemp:ArrayCollection):void{
		 		ac=actemp;
		 	});
		 	return ac;
		 }
		 
		 /**
		 * 得到热门的最多8条旅游套装
		 **/
		 public function getPackageListByIsHot():ArrayCollection{
		 	var ac:ArrayCollection=new ArrayCollection();
		 	packageDAO.getPackageListByIsHot(function (actemp:ArrayCollection):void{
		 		ac=actemp;
		 	});
		 	return ac;
		 }
	}
}